package team.knowers.qzhserver.course.evaluation.entity.dao;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import team.knowers.qzhserver.common.entity.BaseDO;

import java.io.Serial;
import java.util.Date;

/**
 * 课程评价course_evaluation表对应实体类
 * @author xtg
 * @date 2024/1/21 21:22
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName(EvaluationDOField.TABLE_NAME)
public class EvaluationDO extends BaseDO {
    @Serial
    private static final long serialVersionUID = 1L;
    /**
     * 评价id
     */
    @TableId(value = EvaluationDOField.ID, type = IdType.ASSIGN_ID)
    private String id;
    /**
     * 评价用户id
     */
    @TableField(EvaluationDOField.USER_ID)
    private String userId;
    /**
     * 评价课程id
     */
    @TableField(EvaluationDOField.COURSE_ID)
    private String courseId;
    /**
     * 评价内容
     */
    @TableField(EvaluationDOField.CONTENT)
    private String content;
    /**
     * 评价时间
     */
    @TableField(EvaluationDOField.GMT_CREATE)
    private Date gmtCreate;
    /**
     * 评分
     * TODO：考虑在控制层展示评分如何快速计算平均值
     */
    @TableField(EvaluationDOField.MARK)
    private Integer mark;

    //TODO：DTO，VO相关转换
}
